#include<iostream>
#include"ezwin.h"
#include<cassert>
#include "rect.h"
#include<cmath>
using namespace std;
SimpleWindow W("Basic", 26.0, 20.0,
		      Position(1.5, 0.5));
int ApiMain() {
	int i;
	W.Open();

	float x[4],y[4];
	cout<<"enter the values of x & y : "<<endl;
	for(i=0;i<4;i++)
	{
		cin>>x[i];
		cin>>y[i];
	}

	W.RenderLine(Position(2.0,0.5),Position(2.0,16.0),Black,0.05);	//Y-axis
	W.RenderLine(Position(24.5,16.0),Position(2.0,16.0),Black,0.05);	//X-axis

	for(float j=1.0; j<16.0; j+=1.0)
		W.RenderLine(Position(1.9,j),Position(2.1,j),Black,0.05);	//Markings on Y-axis

	for(float j=3.0; j<25.0; j+=1.0)
		W.RenderLine(Position(j,15.9),Position(j,16.1),Black,0.05);	//Markings on X-axis

	for(i=0;i<3;i++)
	{
		W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(x[i]+2.0,16.0-y[i]),Red,0.2);	//Coordinates	
		W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(x[i+1]+2.0,16.0-y[i+1]),Red,0.0);	//Histogram lines
		W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(2.0,16.0-y[i]),Magenta,0.0);	//Projections
		W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(x[i]+2.0,16.0),Magenta,0.0);	//Projections
	}
	W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(x[i]+2.0,16.0-y[i]),Red,0.2);
	W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(2.0,16.0-y[i]),Magenta,0.0);	//Projection of last point
	W.RenderLine(Position(x[i]+2.0,16.0-y[i]),Position(x[i]+2.0,16.0),Magenta,0.0);	//Projection of last point
	return 0;
}

